package com.aeye.mbr.upms.dao.model;

import com.aeye.mbr.model.constant.UpmsDatabaseConstants;
import com.gitee.sunchenbin.mybatis.actable.annotation.DBColumn;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

@Table(name = UpmsDatabaseConstants.TABLE_DICT)
public class UpmsDict implements Serializable {
    @Id
	@DBColumn(type = MySqlTypeConstant.VARCHAR,length = 20,isKey = true)
	private String fieldName;

	@DBColumn(type = MySqlTypeConstant.VARCHAR,length = 32)
	private String fieldComment;

	@DBColumn(type = MySqlTypeConstant.VARCHAR,length = 32)
	private String fieldValue;

	@DBColumn(type = MySqlTypeConstant.VARCHAR,length = 32)
	private String valueComment;

	@DBColumn(type = MySqlTypeConstant.VARCHAR,length = 32)
	private String appFieldName;

	@DBColumn(type = MySqlTypeConstant.INT,length = 2)
	private int status;

	@DBColumn(type = MySqlTypeConstant.INT,length = 2)
	private int orders;

	public String getFieldName() {
		return fieldName;
	}

	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}

	public String getFieldComment() {
		return fieldComment;
	}

	public void setFieldComment(String fieldComment) {
		this.fieldComment = fieldComment;
	}

	public String getFieldValue() {
		return fieldValue;
	}

	public void setFieldValue(String fieldValue) {
		this.fieldValue = fieldValue;
	}

	public String getValueComment() {
		return valueComment;
	}

	public void setValueComment(String valueComment) {
		this.valueComment = valueComment;
	}

	public String getAppFieldName() {
		return appFieldName;
	}

	public void setAppFieldName(String appFieldName) {
		this.appFieldName = appFieldName;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getOrders() {
		return orders;
	}

	public void setOrders(int orders) {
		this.orders = orders;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		UpmsDict dict = (UpmsDict) o;
		return status == dict.status &&
				orders == dict.orders &&
				Objects.equals(fieldName, dict.fieldName) &&
				Objects.equals(fieldComment, dict.fieldComment) &&
				Objects.equals(fieldValue, dict.fieldValue) &&
				Objects.equals(valueComment, dict.valueComment) &&
				Objects.equals(appFieldName, dict.appFieldName);
	}

	@Override
	public int hashCode() {

		return Objects.hash(fieldName, fieldComment, fieldValue, valueComment, appFieldName, status, orders);
	}
}